package com.xy.test.controller;


import com.xy.test.service.StockService;
import com.xy.test.service.TccStockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/stock")
public class StockController {

    @Autowired
    private StockService stockService;
    @Autowired
    private TccStockService tccStockService;

    @RequestMapping("/tccDesc")
    public void tccDesc(@RequestBody Integer prodId) {
        tccStockService.reduceTcc(prodId);
    }

    @RequestMapping("/desc")
    public void desc(@RequestBody Integer prodId) {
        stockService.desc(prodId);
    }
}